package com.example.music.controller;


import com.example.commonutils.R;
import com.example.music.service.BannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName AdminController
 * @Author: wx
 * @Create: 2022-10-04  17:12
 * @Description TODO
 * @Version: 1.0
 **/
@RestController
@RequestMapping("/banner")
@Api(description="获得主页轮播图")
@CrossOrigin //解决跨域问题
public class BannerController {

    @Autowired
    private BannerService bannerService;

    @ApiOperation("获得主页轮播图")
    @GetMapping("/getAllBanner")
    public R getAllBanner(){
        return R.success("成功获取轮播图",bannerService.getAllBanner());
    }
}
